package com.controller;

import java.util.List;
import java.util.Set;

import com.domain.User;
import com.framework.core.domain.BaseControl;
import com.framework.core.myannotation.MyAutowire;
import com.framework.core.myannotation.MyController;
import com.framework.core.myannotation.MyRequestMapping;
import com.service.UserService;

@MyController
public class TestController extends BaseControl {

	@MyAutowire
	private UserService userService;

	@MyRequestMapping("/user")
	public String user(Integer id) {
		User user = userService.user(id);
		getRequest().setAttribute("user", user);
		return "index";
	}

	@MyRequestMapping("/list")
	public String list() {
		List<User> list = userService.list();
		getRequest().setAttribute("list", list);
		return "index";
	}

	@MyRequestMapping("/set")
	public String set() {
		Set<String> set = userService.set();
		getRequest().setAttribute("set", set);
		return "index";
	}
}
